package com.juyu.reader.author.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.juyu.reader.author.dao.BookChapterDao;
import com.juyu.reader.author.model.BookChapter;

@Service
public class BookChapterService {
	@Autowired
	private BookChapterDao bookChapterDao;

	public List<BookChapter> findBookChapter(BookChapter bookChapter) {
		return bookChapterDao.findBookChapter(bookChapter);
	}

	public List<BookChapter> findBookChapterById(int chapterId) {
		return bookChapterDao.findBookChapterById(chapterId);
	}

	public List<BookChapter> findBookChapterPublish(BookChapter bookChapter) {
		return bookChapterDao.findBookChapterPublish(bookChapter);
	}

	/**
	 * 查询该书籍最后章节排序号
	 * 
	 * @param bookChapter
	 * @return
	 */
	public List<BookChapter> findBookChapterLastSeq(int bookId) {
		return bookChapterDao.findBookChapterLastSeq(bookId);
	}

	/**
	 * 查询该书籍最后更新发布的章节
	 * 
	 * @param bookChapter
	 * @return
	 */
	public List<BookChapter> findBookChapterLastPublish(int bookId) {
		return bookChapterDao.findBookChapterLastPublish(bookId);
	}

	public int countBookChapter(BookChapter bookChapter) {
		return bookChapterDao.countBookChapter(bookChapter);
	}

	public int countBookChapterPublish(BookChapter bookChapter) {
		return bookChapterDao.countBookChapterPublish(bookChapter);
	}

	public int insertBookChapter(BookChapter bookChapter) {
		return bookChapterDao.insertBookChapter(bookChapter);
	}

	public int deleteBookChapter(BookChapter bookChapter) {
		return bookChapterDao.deleteBookChapter(bookChapter);
	}

	public int publishBookChapter(BookChapter bookChapter) {
		return bookChapterDao.publishBookChapter(bookChapter);
	}
	
	public int updateBookChapter(BookChapter bookChapter) {
		return bookChapterDao.updateBookChapter(bookChapter);
	}
}
